package insight.google.game.era.bo.policy;

import java.util.ArrayList;
import java.util.List;

import insight.google.game.era.bo.card.CharacterCard;
import insight.google.game.era.bo.policy.character.CaoCaoPolicy;
import insight.google.game.era.bo.policy.character.CharacterPolicy;
import insight.google.game.era.bo.policy.character.GuoJiaPolicy;
import insight.google.game.era.bo.policy.character.LiuBeiPolicy;
import insight.google.game.era.bo.policy.character.SunQuanPolicy;
import insight.google.game.era.bo.policy.character.ZhangFeiPolicy;
import insight.google.game.era.bo.policy.character.ZhouYuPolicy;
import insight.google.game.era.bo.policy.gamecard.*;
import insight.google.game.era.data.policys.Policy;

public class PolicyFactory {

	public static Policy getInstance(int policyId){
		switch(policyId){
			//character card policy
			case PolicyCenter.POLICY_CHARACTER_CARD_CAOCAO_JIANXIOING:
				//set cao cao policy --JianXiong
				CharacterPolicy policy = new CaoCaoPolicy("jianXiong", "JianX");
				policy.setType(CharacterPolicy.TYPE_BE_HURTED);
				policy.setIsFixed(true);
				return policy;
//			case PolicyCenter.POLICY_CHARACTER_CARD_CAOCAO_HUJIA:
//				//set the second policy --HuJia
//				policy = new CaoCaoPolicy("huJia", "HuJia");
//				policy.setType(CharacterPolicy.TYPE_BE_HURTED);
//				policy.setIsFixed(true);
//				return policy;
			case PolicyCenter.POLICY_CHARACTER_CARD_LIUBEI_RENDE:
				//set liu bei policy
				policy = new LiuBeiPolicy("renDe", "RenD");
				policy.setType(CharacterPolicy.TYPE_ON_DISCARD);
				policy.setIsFixed(false);
				return policy;
			case PolicyCenter.POLICY_CHARACTER_CARD_SUNQUAN_ZHIHENG:
				//set sun quan policy
				policy = new SunQuanPolicy("sunq", "ZhiH");
				policy.setType(CharacterPolicy.TYPE_ON_DISCARD);
				policy.setIsFixed(false);
				return policy;
			case PolicyCenter.POLICY_CHARACTER_CARD_ZHANGFEI_PAOXIAO:
				//set zhang fei policy
				policy = new ZhangFeiPolicy("zhangf", "BaoX");
				policy.setType(CharacterPolicy.TYPE_ON_DISCARD);
				policy.setIsFixed(false);
				return policy;
			case PolicyCenter.POLICY_CHARACTER_CARD_ZHOUYU_YINZI:
				//set zhou yu policy
				policy = new ZhouYuPolicy("zhouyu", "YinZ");
				policy.setType(CharacterPolicy.TYPE_ON_DISCARD);
				policy.setIsFixed(true);
				return policy;
			case PolicyCenter.POLICY_CHARACTER_CARD_GUOJIA_YIJI:
				//set guojia policy
				policy = new GuoJiaPolicy("guojia", "YiJi");
				policy.setType(CharacterPolicy.TYPE_BE_HURTED);
				policy.setIsFixed(true);
				return policy;
			case PolicyCenter.POLICY_CHARACTER_CARD_ZHAOYUN_LONGDAN:
				//set zhao yun policy
				policy = new GuoJiaPolicy("zhaoyun", "LongD");
				policy.setType(CharacterPolicy.TYPE_ON_DISCARD);
				policy.setIsFixed(false);
				return policy;
			case PolicyCenter.POLICY_CHARACTER_CARD_HUANGGAI_KUROU:
				//set zhang fei policy
				policy = new GuoJiaPolicy("huanggai", "KuR");
				policy.setType(CharacterPolicy.TYPE_ON_DISCARD);
				policy.setIsFixed(false);
				return policy;

			//game card policy
			case PolicyCenter.POLICY_GAME_CARD_ATTACK:
				return new AttackPolicy();
			case PolicyCenter.POLICY_GAME_CARD_DEFEND:
				return new DefendPolicy();
			case PolicyCenter.POLICY_GAME_CARD_MILK:
				return new MilkPolicy();
			case PolicyCenter.POLICY_GAME_CARD_WEAPON:
				return new WeaponPolicy();
			case PolicyCenter.POLICY_GAME_CARD_ATTACKHORSE:
				return new AttackHorsePolicy();
			case PolicyCenter.POLICY_GAME_CARD_DEFENDHORSE:
				return new DefendHorsePolicy();
			default:
				return null;
		}
	}
}
